package com.erp.service.impl;

import com.erp.bean.Inventory;
import com.erp.dao.InventoryDao;
import com.erp.dao.impl.InventoryDaoImpl;
import com.erp.service.InventoryService;

import java.util.List;

/**
 * @author mtf
 * 库存业务逻辑实现类
 */
public class InventoryServiceImpl implements InventoryService {
    InventoryDao inventoryDao = new InventoryDaoImpl();

    @Override
    public List<Inventory> findAll() {
        return inventoryDao.findAll();
    }

    @Override
    public Inventory findByInvId(int invid) {
        return inventoryDao.findByInvId(invid);
    }

    @Override
    public boolean add(Inventory inventory) {
        return inventoryDao.add(inventory)>0?true:false;
    }

    @Override
    public boolean update(Inventory inventory) {
        return inventoryDao.update(inventory)>0?true:false;
    }

    @Override
    public List<Inventory> findByEntid(int entid) {
        return inventoryDao.findByEntid(entid);
    }

    @Override
    public List<Inventory> findByGid(int gid) {
        return inventoryDao.findByGid(gid);
    }

    @Override
    public List<Inventory> find(String column, String value) {
        return inventoryDao.find(column, value);
    }

    @Override
    public Inventory findByGidob(int gid, int entid) {
        return inventoryDao.findByGidob(gid,entid);
    }

    @Override
    public List<Inventory> limit(int page) {
        return inventoryDao.limit(page);
    }
}
